package com.lepu.app.fun.grow.bean;

import java.util.ArrayList;
import java.util.List;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;

public class PhotoItemNet {

	public String PhotoID;
	public String PhotoUrl;
	public String Description;
	public String TakePictureDate;
	
	public static ArrayList<PhotoItemNet> parseJsonData(String dataString)
	{
		String result = "";
		try {
			JSONObject jsonObject = new JSONObject(dataString);
			JSONObject obj1 = (JSONObject) jsonObject.get("Result");
			JSONArray obj2 = (JSONArray) obj1.get("ListInfo");
			
			result = obj2.toString();
		} catch (JSONException e) {
			e.printStackTrace();
		}
		
		Gson gson = new Gson();
		ArrayList<PhotoItemNet> dataList = gson.fromJson(result,
				new TypeToken<List<PhotoItemNet>>() {
				}.getType());
		return dataList;
	}
}
